<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>svg矢量图</title>
  <style>
    .calendarCom{
      box-sizing: border-box;
      width: 100vw;
      height: auto;
      font-size: 20px;
      padding-left:200px ;
      z-index: 2;
      position: relative;
    }
    /* loading */
    circle {
      fill: transparent;
    }
    #circle {
      stroke-dasharray: 250;
      stroke-dashoffset: 250; /* pi*r*2 大约是250 */
      animation: round 3s linear infinite;
    }
    /* 
      stroke-dasharray为一个参数时： 其实是表示虚线长度和每段虚线之间的间距
　　 如：stroke-dasharray = '10' 表示：虚线长10，间距10，然后重复 虚线长10，间距10

      stroke-dashoffset： offset：偏移的意思
      这个属性是相对于起始点的偏移，正数偏移x值的时候，相当于往左移动了x个长度单位，负数偏移x的时候，相当于往右移动了x个长度单位。
      需要注意的是，不管偏移的方向是哪边，dasharray 是循环的，也就是 虚线-间隔-虚线-间隔。
     */
    @keyframes round {
      to {
        stroke-dashoffset: 0;
      }
    }
      /* text */
      #text1{
        stroke: red;
        fill:#fff;
        stroke-dashoffset: 4;
        stroke-dasharray: 0 35%;
        font-size: 20px;
        animation: animationText 5s linear infinite forwards;
      }
      @keyframes animationText {
          0% {
           stroke-dasharray: 0, 378;
          }
          40% {
            stroke-dasharray: 378, 378;
            fill: rgba(0, 0, 0, 0);
            opacity: 1;
          }
          100% {
            stroke-dasharray: 378, 378;
            fill: red;
            opacity: 0;
          }
      }
      /* 按钮 */
    .noselect{
          user-select: none;
          -webkit-tap-highlight-color: transparent;
    }
    button {
      width: 160px;
      height: 50px;
      cursor: pointer;
      display: flex;
      align-items: center;
      background: red;
      border: none;
      border-radius: 5px;
      box-shadow: 1px 1px 3px rgba(0,0,0,0.15);
      background: #e62222;
    }
    button .text {
      transform: translateX(35px);
      color: white;
      font-weight: bold;
      font-size: 15px;
    }
    button span {
     transition: 200ms;
    }
    button .icon {
      position: absolute;
      border-left: 1px solid #c41b1b;
      transform: translateX(110px);
      height: 40px;
      width: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    button svg {
      width: 15px;
      fill: #eee;
    }
    button:hover .text {
      color: transparent;
    }
    button:hover {
      background: #ff3636;
    }
    button:hover .icon {
      width: 150px;
      border-left: none;
      transform: translateX(0);
    }
    
  </style>
</head>
<body>
  <div class="calendarCom">
    <!-- iconfont -->
    <p>1.iconfont</p>
    <div>
      <img src="./add-iconfont.svg" alt="">
      <img src="./radio.svg" style="width: 120px;height: 120px;"/>
    </div>
    <p>2.loading动画</p>
    <div>
      <svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg">
        <g>
          <circle cx="50" cy="60" r="40" stroke="#ccc" stroke-width="10" />
          <circle id="circle" cx="50" cy="60" r="40" stroke="orange" stroke-width="10" />
        </g>
      </svg>
    </div>
    <!-- HUOLALA 线性动画 -->
    <p>3.线性动画</p>
    <!-- 设置了不同的stroke-dasharray和stroke-dashoffset动画参数，从而实现了这种效果 -->
    <div>
      <svg width="500" height="240" version="1.1" xmlns="http://www.w3.org/2000/svg">
        <symbol id="text">
          <text x="10" y="130" class="text" font-size="90">HUOLALA</text>
        </symbol>
        <g>
          <!-- SVG <use>元素可以重用SVG文档中其他位置（包括 <g>元素和 <symbol>元素）的SVG形状 -->
          <use xlink:href="#text" id="text1" class="text"></use>
        </g>
      </svg>
    </div>
    <p>4.按钮</p>
    <button class="noselect">
      <span class="text">Delete</span>
      <span class="icon">
        <svg xmlns="http://www.w3.org/2000/svg"
        width="24" height="24" viewBox="0 0 24 24">
          <path
            d="M24 20.188l-8.315-8.209 8.2-8.282-3.697-3.697-8.212 8.318-8.31-8.203-3.666 3.666 8.321 8.24-8.206 8.313 3.666 3.666 8.237-8.318 8.285 8.203z">
          </path>
        </svg>
      </span>
    </button>
    <p>5.水印</p>
    <script src="./waterPrint.js"></script>
</body>
</html>